import {
  Controller,
  Get,
  UseGuards,
} from '@nestjs/common';
import { ApiOkResponse, ApiOperation, ApiTags } from '@nestjs/swagger';
import { ResourceService } from './resource.service';
import { AdminAuthGuard } from "@/common/auth/admin-auth.guard";
import {
  ResourceAdminAllResult,
} from "@/module/resource/resource.result";

@Controller('/v1/admin/resources')
@ApiTags('Resource_admin')
@UseGuards(AdminAuthGuard)
export class ResourceV1AdminController {
  constructor(private readonly resourceService: ResourceService) {
  }

  @Get('/all')
  @ApiOperation({ summary: '全部' })
  @ApiOkResponse({ type: ResourceAdminAllResult, isArray: true })
  async all(): Promise<ResourceAdminAllResult[]> {
    const res = await this.resourceService.adminAll();
    return res;
  }

}
